import request from "@/utils/request";

/**
 * 工艺规程下工序工步信息
 * @method getList 查询工艺规程下的工序工步信息
 * @method submitToCheck 检验提交
 * @method setFinishWorkDate 设置完工时间
 * @method getMpmProcess 获取MPM中的工序详情
 * @method getMpmProcessMaterial 获取MPM中的工序配套物料
 * @method getMpmProcessAuxiliary 获取MPM中的工序辅料
 * @method getMpmProcessFile 获取MPM中的工序附件
 * @method downloadFileInProcess 下载工序附件
 * @method getListForCheck 获取检验所属工序任务
 * @method checkQualified 检验合格
 * @method checkReturn 检验退回
 * @method getMpmProcessHasChildren 获取工序信息待子级工步
 * @method checkRevoke 撤回检验
 * @method addNumber 取号
 * @method getMpmDevice 工序或工步的配置资源
 *
 */

export function getList(params) {
    return request({
        url: "/mes/processTaskController/listTaskHasBill",
        method: "post",
        data: params,
    });
}
export function getListForCheck(params,loading) {
    return request({
        url: "/mes/processTaskController/listTaskForCheck",
        method: "post",
        data: params,
        loading
    });
}
//检验提交
export function submitToCheck(params,loading) {
    return request({
        url: "/mes/processTaskController/submitToCheck",
        method: "post",
        data: params,
        loading
    });
}
//设置完工时间
export function setFinishWorkDate(params,loading) {
    return request({
        url: "/mes/processTaskController/setFinishWorkDate",
        method: "post",
        data: params,
        loading
    });
}
export function getMpmProcess(params,loading) {
    return request({
        url: "/mpm/processController/list",
        method: "post",
        data: params,
        loading
    });
}
export function getMpmProcessHasChildren(params,loading) {
    return request({
        url: "/mpm/processController/listHasChildren",
        method: "post",
        data: params,
        loading
    });
}
export function getMpmProcessMaterial(params,loading) {
    return request({
        url: "/mpm/processController/listMaterial",
        method: "post",
        data: params,
        loading
    });
}
export function getMpmProcessAuxiliary(params,loading) {
    return request({
        url: "/mpm/processController/listAuxiliaryMaterials",
        method: "post",
        data: params,
        loading
    });
}
export function getMpmDevice(params,loading) {
    return request({
        url: "/mpm/processController/listDevice",
        method: "post",
        data: params,
        loading
    });
}
export function getMpmProcessFile(params,loading) {
    return request({
        url: "/mpm/processController/listFile",
        method: "post",
        data: params,
        loading
    });
}
export function downloadFileInProcess(params,loading) {
    return request({
        url: "/mpm/processController/downloadFileInProcess",
        method: "get",
        responseType: 'blob',
        params,
        loading
    });
}
export function checkQualified(params,loading) {
    return request({
        url: "/mes/processTaskController/checkQualified",
        method: "post",
        data: params,
        loading
    });
}
export function checkReturn(params,loading) {
    return request({
        url: "/mes/processTaskController/checkReturn",
        method: "post",
        data: params,
        loading
    });
}

export function checkRevoke(params,loading) {
    return request({
        url: "/mes/processTaskController/checkRevoke",
        method: "post",
        data: params,
        loading
    });
}

export function addNumber(params,loading) {
    return request({
        url: "/mes/takeNumberController/add",
        method: "post",
        data: params,
        loading
    });
}

export function deleteNumber(ids,loading) {
    return request({
        url: "/mes/takeNumberController/" + ids,
        method: "delete",
        loading
    });
}
export function takeNumberEditDes(params,loading) {
    return request({
        url: "/mes/takeNumberController/edit",
        method: "put",
        data: params,
        loading
    });
}

export function deleteFile(params,loading) {
    return request({
        url: "/mes/fileController/deleteFile",
        method: "delete",
        data:params,
        loading
    });
}

